<?php



class AuthModule extends Module
{
	public $helper;
	
	public function __config()
	{
		
		$this->helper = new PTHelper( $this->site );
		
		$this->site->db->driver_connect();
		
		$this->helper->header_html();
	}
	
	
	public function __default()
	{
		
	}
	
	
	public function AAction()
	{
		$this->helper->db_auth_user();
		
		if ( intval($this->helper->serv_data['id']) > 0 )
		{
			session_start();
			$_SESSION = array_merge($this->helper->serv_data, $this->helper->ok_data);
			header("Location: /home");
		}
		else
		{
			// Show authorize error?
		}
		
		//q_print_r($this->site->get);
		
		
	}
}